home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / gcc / gcc270_src.lha / gcc-2.7.0-amiga / config / ns32k / encore.h next >
C/C++ Source or Header  |  1995-06-15  |  7KB  |  197 lines

  1. /* Definitions of target machine for GNU compiler.  ENCORE NS32000 version.
  2.    Copyright (C) 1988, 1993 Free Software Foundation, Inc.
  3.    Adapted by Robert Brown (brown@harvard.harvard.edu) from the Sequent
  4.    version by Michael Tiemann (tiemann@mcc.com).
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2, or (at your option)
  11. any later version.
  12.  
  13. GNU CC is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with GNU CC; see the file COPYING.  If not, write to
  20. the Free Software Foundation, 59 Temple Place - Suite 330,
  21. Boston, MA 02111-1307, USA.  */
  22.  
  23.  
  24. #define EXTERNAL_PREFIX '?'
  25. #define IMMEDIATE_PREFIX '$'
  26.  
  27. #include "ns32k/ns32k.h"
  28.  
  29. #define SDB_DEBUGGING_INFO
  30. #undef DBX_REGISTER_NUMBER
  31. #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
  32.  
  33. /* Cause long-jump assembler to be used,
  34.    since otherwise some files fail to be assembled right.  */
  35. #define ASM_SPEC "-j"
  36.  
  37. #undef ASM_FILE_START
  38. #undef ASM_GENERATE_INTERNAL_LABEL
  39. #undef ASM_OUTPUT_ADDR_DIFF_ELT
  40. #undef ASM_OUTPUT_ALIGN
  41. #undef ASM_OUTPUT_ASCII
  42. #undef ASM_OUTPUT_DOUBLE
  43. #undef ASM_OUTPUT_INT
  44. #undef ASM_OUTPUT_INTERNAL_LABEL
  45. #undef ASM_OUTPUT_LOCAL
  46. #undef CPP_PREDEFINES
  47. #undef FUNCTION_BOUNDARY
  48. #undef PRINT_OPERAND
  49. #undef PRINT_OPERAND_ADDRESS
  50. #undef TARGET_VERSION
  51. #undef FUNCTION_PROFILER
  52. #undef ASM_OUTPUT_LABELREF_AS_INT
  53.  
  54. #define TARGET_DEFAULT 9  /* 32332 with 32081.  */
  55. #define TARGET_VERSION fprintf (stderr, " (32000, Encore syntax)");
  56. /* Note Encore does not standardly do -Dencore.  */
  57. /* budd: should have a -ns32332 (or -apc) switch! but no harm for now */
  58. #define CPP_PREDEFINES "-Dns32000 -Dn16 -Dns16000 -Dns32332 -Dunix -Asystem(unix) -Acpu(ns32k) -Amachine(ns32k)"
  59.  
  60. /* Ignore certain cpp directives used in header files on sysV.  */
  61. #define SCCS_DIRECTIVE
  62.  
  63. /* Output #ident as a .ident.  */
  64. #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
  65.  
  66. /* The .file command should always begin the output.  */
  67. #define ASM_FILE_START(FILE) \
  68. output_file_directive ((FILE), main_input_filename)
  69.  
  70. #define FUNCTION_BOUNDARY 128        /* speed optimization */
  71.  
  72. /*
  73.  *  The Encore assembler uses ".align 2" to align on 2-byte boundaries.
  74.  */
  75.  
  76. #define ASM_OUTPUT_ALIGN(FILE,LOG)                    \
  77.     fprintf (FILE, "\t.align %d\n", 1 << (LOG))
  78.  
  79. /* The Encore assembler doesn't seem to accept the usual second argument
  80.    and warns that .align may not work in the text section if optimization
  81.    is on.  */
  82. #undef ASM_OUTPUT_ALIGN_CODE
  83. #define ASM_OUTPUT_ALIGN_CODE(FILE)
  84.  
  85. /*
  86.  *  Internal labels are prefixed with a period.
  87.  */
  88.  
  89. #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)            \
  90.     sprintf (LABEL, "*.%s%d", PREFIX, NUM)
  91. #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)            \
  92.     fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
  93. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)            \
  94.     fprintf (FILE, "\t.double .L%d-.LI%d\n", VALUE, REL)
  95.  
  96. /*
  97.  *  Different syntax for integer constants, double constants, and
  98.  *  uninitialized locals.
  99.  */
  100.  
  101. #define ASM_OUTPUT_INT(FILE,VALUE)                \
  102. ( fprintf (FILE, "\t.double "),                    \
  103.   output_addr_const (FILE, (VALUE)),                \
  104.   fprintf (FILE, "\n"))
  105.  
  106. #define ASM_OUTPUT_LABELREF_AS_INT(STREAM, NAME)            \
  107. do {                                    \
  108.   fprintf (STREAM, "\t.double\t");                    \
  109.   ASM_OUTPUT_LABELREF (STREAM, NAME);                    \
  110.   fprintf (STREAM, "\n");                        \
  111. } while (0)
  112.  
  113.  
  114. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                \
  115.  fprintf (FILE, "\t.long 0f%.20e\n", (VALUE))
  116.  
  117. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)        \
  118. ( fputs ("\t.bss ", (FILE)),                    \
  119.   assemble_name ((FILE), (NAME)),                \
  120.   fprintf ((FILE), ",%u,%u\n", (SIZE), (ROUNDED)))
  121.  
  122.  /*
  123.   *  Encore assembler can't handle huge string constants like the one in
  124.   *  gcc.c.  If the default routine in varasm.c were more conservative, this
  125.   *  code could be eliminated.  It starts a new .ascii directive every 40
  126.   *  characters.
  127.   */
  128.  
  129. #define ASM_OUTPUT_ASCII(file, p, size)            \
  130. do {                            \
  131.   int i;                        \
  132.   for (i = 0; i < (size); i++)                \
  133.     {                            \
  134.       register int c = (p)[i];                \
  135.       if ((i / 40) * 40 == i)                \
  136.       if (i == 0)                    \
  137.         fprintf ((file), "\t.ascii \"");        \
  138.       else                        \
  139.         fprintf ((file), "\"\n\t.ascii \"");        \
  140.       if (c == '\"' || c == '\\')            \
  141.         putc ('\\', (file));                \
  142.       if (c >= ' ' && c < 0177)                \
  143.         putc (c, (file));                \
  144.       else                        \
  145.         {                        \
  146.           fprintf ((file), "\\%o", c);            \
  147.           if (i < (size) - 1                 \
  148.               && (p)[i + 1] >= '0' && (p)[i + 1] <= '9')\
  149.           fprintf ((file), "\"\n\t.ascii \"");        \
  150.         }                        \
  151.     }                            \
  152.   fprintf ((file), "\"\n");                \
  153. } while (0)
  154.  
  155. /* Modify syntax of jsr instructions.  */
  156. #define CALL_MEMREF_IMPLICIT
  157.  
  158. #define NO_ABSOLUTE_PREFIX_IF_SYMBOLIC
  159.  
  160. #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE, X, CODE)
  161.  
  162. #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  print_operand_address(FILE, ADDR)
  163.  
  164. /* Change the way in which data is allocated and initialized on the
  165.    encore so that both private and shared data are supported.  Shared data
  166.    that is initialized must be contained in the ".shrdata" section
  167.    of the program.  This is accomplished by defining the SHARED_SECTION_ASM_OP
  168.    macro.  Share data that is simply allocated, and not initialized must
  169.    be prefixed with the ".shrcomm" or ".shrbss" pseudo op, for common or
  170.    local data respectively.  This is accomplished by redefining the
  171.    ASM_OUTPUT_COMMON and ASM_OUTPUT_LOCAL macros. */
  172.     
  173. /* Assembler pseudo-op for shared data segment. */
  174.  
  175. #define SHARED_SECTION_ASM_OP ".shrdata"
  176.  
  177. /* This says how to output an assembler line
  178.    to define a shared common symbol. */
  179.  
  180. #define ASM_OUTPUT_SHARED_COMMON(FILE, NAME, SIZE, ROUNDED) \
  181. ( fputs (".shrcomm ", (FILE)),            \
  182.   assemble_name ((FILE), (NAME)),        \
  183.   fprintf ((FILE), ",%d\n", (ROUNDED)))
  184.  
  185. /* This says how to output an assembler line
  186.    to define a shared local symbol. */
  187.  
  188. #define ASM_OUTPUT_SHARED_LOCAL(FILE, NAME, SIZE, ROUNDED) \
  189. ( fputs ("\t.shrbss ", (FILE)),                \
  190.   assemble_name ((FILE), (NAME)),            \
  191.   fprintf ((FILE), ",%d,%d\n", (SIZE), (ROUNDED)))
  192.  
  193. #define FUNCTION_PROFILER(FILE, LABELNO)  \
  194.    fprintf (FILE, "\taddr .LP%d,r0\n\tjsr mcount\n", (LABELNO))
  195.  
  196. #define ENCORE_ASM
  197.